package com.adira.fraud.util;

import java.util.Date;

import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;

public class EncryptorManager {
	//private StandardPBEStringEncryptor encryptor = null;
	private static StandardPBEStringEncryptor getEncryptor() {
		
		//if (encryptor==null){
		StandardPBEStringEncryptor	encryptor = new StandardPBEStringEncryptor();
		//}

		encryptor.setPassword("rendra hermawan");
		encryptor.setAlgorithm("PBEWithMD5AndDES");
		return encryptor;
	}

	public static String encrypt(String plainText){
		return getEncryptor().encrypt(plainText);
	}
	
	public static String encrypt(Date date){
		
		return getEncryptor().encrypt("");
	}
	
	public static String encrypt(int number){
		return getEncryptor().encrypt("");
	}

	public static String decrypt(String cipherText){
		return getEncryptor().decrypt(cipherText);
	}
	
	/*public static void main(String[] Args){
		System.out.println(EncryptorManager.encrypt("rendra"));
	}*/
	
	
}
